<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>猫眼电影首页渲染</title>
    <link href="./css/maoyan.css" rel="stylesheet" />
    <style>

      .yingyuan {
        margin-left: 15px;
        padding: 13px 0 118px 0;
        background-color: #fff;
        flex: 1;
        margin-top: 517px;
      }

      .msgList-block {
        border-bottom: 1px solid gray;
        padding: 20px 0 15px 15px;
      }

      div {
        margin-bottom: 15px;
      }

      .yy-name {
        color: #000;
        font-size: 16px;
      }

      .yy-price {
        color: red;
      }

      .yy-add {
        color: #666;
        font-size: 13px;
        padding-bottom: 10px;
      }

      .yy-tag-block {
        display: flex;
        margin-top: 20px;
      }

      .yy-tag{
        margin-right: 20px;
      }

      .tag-con {
        font-size: 33px;
        border: 1px solid;
        border-radius: 8px;
        padding: 5px 10px;
        margin: 0 10px 0 0;
      }

      .kaika {
        color: #999;
        font-size: 12px;
      }
    </style>
  </head>
  <body>
    <div id="movie">
      <myheader></myheader>
      <!-- <mycontent :movie="movie"></mycontent> -->
      <mymsg :msgdata="yingyuan"></mymsg>
      <myfooter></myfooter>
    </div>
    <script src="./axios.min.js"></script>
    <script src="./flexible.js"></script>
    <script src="./vue.js"></script>
    <script type="template" id="con">
      <div class="yingyuan">
        <div class="msgList-block" v-for="item in msgdata">
          <div class="yy-title">
            <span class="yy-name">{{ item.nm }}</span>
            <span class="yy-price" style="font-size:18px">{{ item.price }}</span>
            <span class="yy-price" style="font-size:12px">元起</span>
          </div>
          <div class="yy-place">
            <span class="yy-add">{{ item.addr }}</span>
          </div>
          <div class="yy-tag-block">
            <div class="yy-tag">
              <span class="tag-con" v-for="i in item.labels" :style="{'color':i.color}">{{ i.name }}</span>
            </div>
          </div>
          <div class="yy-kaika">
            <span class="kaika">{{ item.promotion.cardPromotionTag }}</span>
          </div>
        </div>
      </div>
    </script>
    <script>
      let myheader = {
        template: `
          <div class="header">
              <img src="./img/top.png" alt="">
          </div>`,
      };

      // let mycontent = {
      //   data() {
      //     return {
      //       red: "red",
      //       blue: "blue",
      //     };
      //   },
      //   props: ["movie"],
      //   template: `
      //     <div>
      //       <div class="context" v-for="item in movie">
      //         <img :src="item.img" alt="">
      //         <div class="introduce">
      //           <div class="main">
      //             <h1>{{ item.nm }}</h1>
      //             <span v-if="item.globalReleased">
      //               观众评<em>{{ item.mk }}</em>
      //             </span>
      //             <span v-else>
      //               <em>{{ item.wish }}</em>人想看
      //             </span>
      //             <span>{{ item.desc }}</span>
      //             <span>{{ item.showInfo }}</span>
      //           </div>
      //           <button :class="item.showStateButton.content === '购票' ? red : blue">
      //             {{ item.showStateButton.content }}
      //           </button>
      //         </div>
      //       </div>
      //     </div>
      //     `,
      // };

      let mymsg = {
        props: ["msgdata"],
        template: `#con`,
      };

      let myfooter = {
        template: `
          <div class="footer">
              <img src="./img/footer.png" alt="">
          </div>`,
      };

      let vm = new Vue({
        el: "#movie",
        data: {
          movie: [],
          yingyuan: [],
        },
        methods: {},
        created() {
          axios.get("./json/hot.json").then((res) => {
            this.movie = res.data.data.hot;
          });
          axios.get("./json/yingyuan.json").then((res) => {
            console.log(res.data.data.cinemas);
            this.yingyuan = res.data.data.cinemas;
          });
        },
        components: {
          myheader,
          // mycontent,
          mymsg,
          myfooter,
        },
      });
    </script>
  </body>
</html>
